package com.chenyuxin.ilp.controller.user;

import com.chenyuxin.ilp.model.pojo.Result;
import com.chenyuxin.ilp.service.user.UserStatisticsService;
import com.chenyuxin.ilp.util.SecurityUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/user/statistic")
public class UserStatisticsController {
    @Autowired
    private UserStatisticsService userStatisticsService;
    @GetMapping
    public Result getUserStatistic(){
        String userId = SecurityUtil.getUserId();
        return userStatisticsService.getUserStatistic(userId);
    }
}
